package com.sg.service.impl;

import com.sg.bean.ShopCommodity;
import com.sg.dao.ShopCommodityDao;
import com.sg.service.ShopCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wangcf
 * @Description 商品购物车关系业务逻辑接口实现
 * @date 2023/3/14 10:13
 */
@Service
public class ShopCommodityServiceImpl implements ShopCommodityService {

    @Autowired
    private ShopCommodityDao shopCommodityDao;
    @Override
    public ShopCommodity findBySCId(int scId) {
        return shopCommodityDao.findBySCId(scId);
    }

    @Override
    public boolean add(ShopCommodity shopCommodity) {
        return shopCommodityDao.add(shopCommodity)>0?true:false;
    }

    @Override
    public boolean update(ShopCommodity shopCommodity) {
        return shopCommodityDao.update(shopCommodity)>0?true:false;
    }

    @Override
    public ShopCommodity findByShopIdAndComId(int shopId, int comId) {
        return shopCommodityDao.findByShopIdAndComId(shopId,comId);
    }
}
